<template>
  <div>
    <Header></Header>
    <router-view ></router-view>
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
import Header from './components/Header'
import Footer from './components/Footer'
export default {
  name: '',
  components:{
    Header,
    Footer,
  },
//获取三级联动数据性能优化，在App中只发送一次请求
  created(){
    this.$store.dispatch('getCategory')
  },
  beforeCreate () {
    this.$nextTick(()=>{
      document.body.setAttribute('style', 'background:#f8f8f8')
    })
  },
  //实例销毁之前钩子--移除body 标签的属性style
  beforeDestroy () {
    document.body.removeAttribute('style')
  }


}

</script>

<style scoped>
 

</style>
